
package com.yimixian.app.util;

import android.os.Looper;

public class ThreadUtils {

    public static String currentThreadName() {
        Thread thread = Thread.currentThread();
        return "[" + thread.getName() + "," + thread.getId() + "] ";
    }

    public static void assertOnUiThread() {
        if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
            throw new RuntimeException("Assert on main thread failed");
        }
    }
}
